Release 10.1A: OpenEdge Data Management:
DataServer for ODBC
RUN STORED–PROCEDURE statement
Runs a non-Progress stored procedure or allows you to send SQL to an SQL-based data source using a DataServer.
Syntax
procedureThe name of the stored procedure that you want to run or the Progress built-in procedure name,
send–sql–statement, to send SQL to an SQL-based data source.integer–field= PROC–HANDLEAssigns a value to the specified integer field or variable (
integer–field) that uniquely identifies the stored procedure returning results from the non-OpenEdge database or that uniquely identifies the SQL cursor used to retrieve results from an ODBC-compliant data source.NO–ERRORSpecifies that any ERROR conditions that the
RUNSTORED–PROCEDUREstatement produces are suppressed. Before you close a stored procedure, check theERROR–STATUShandle for information on any errors that occurred. You receive an error when you attempt to close a stored procedure that did not start. TheNO-ERRORoption must appear before any run-time parameter list.parameterA run-time parameter to be passed to the stored procedure. A
parameterhas the following syntax:
An
expressionis a constant, field name, variable name, or expression.INPUTis the default.OUTPUTandINPUT–OUTPUTparameters must be record fields or program variables.If you run send–sql–statement for an SQL-based data source, you must pass a single character expression
parametercontaining the SQL statement you want the data source to execute.If you do not specify
Examplesparameter–name(the name of a keyword parameter defined by the stored procedure), you must supply all of the parameters in correct order. If you do specifyparameter–name, you must precede your assignment statement with the keywordPARAM. If you do not supply a required parameter, and no default is specified in the stored procedure, you receive a run-time error.This procedure runs the stored procedure pcust and writes the results of the stored procedure into the Progress 4GL buffer,
proc–text–buffer:
This procedure uses the
send–sql–statementoption of theRUNSTORED–PROCEDUREstatement to send SQL to an ODBC-compliant data source. It writes the results of the stored procedure into the Progress 4GL buffer,proc–text–buffer:
This code example shows how to trap errors from the non-OpenEdge RDBMS within a procedure:
Note
The
RUNSTORED–PROCEDUREstatement starts a transaction with the same scope as transactions started with theUPDATEstatement.See also
CLOSE STORED–PROCEDURE statement, PROC–HANDLE function, PROC–STATUS function
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |